<?php
if ($_POST['btnSair'] != "") {
    
    $sql_log = "INSERT INTO log (cli_id,log_data,log_hora,log_ip,log_acao) VALUES 
    ('{$_SESSION['cli_id']}','".date("Y-m-d")."','".date("H:i")."','".getenv("REMOTE_ADDR")."','sair')";
    sql($sql_log);
    
    session_destroy();
    unset($_SESSION);
    ?><script type="text/javascript">location.href='index.php';</script><?php
    
}